using Google.ProtocolBuffers;
using micromsg.Proto;
using System;
using System.CodeDom.Compiler;
using System.Diagnostics;
using System.IO;
using System.Runtime.CompilerServices;
namespace micromsg
{
	[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
	public sealed class BuiltinIP : GeneratedMessageLite<BuiltinIP, BuiltinIP.Builder>
	{
		[GeneratedCode("ProtoGen", "2.3.0.277"), DebuggerNonUserCode, CompilerGenerated]
		public sealed class Builder : GeneratedBuilderLite<BuiltinIP, BuiltinIP.Builder>
		{
			private bool resultIsReadOnly;
			private BuiltinIP result;
			protected override BuiltinIP.Builder ThisBuilder
			{
				get
				{
					return this;
				}
			}
			public override bool IsInitialized
			{
				get
				{
					return this.result.IsInitialized;
				}
			}
			protected override BuiltinIP MessageBeingBuilt
			{
				get
				{
					return this.PrepareBuilder();
				}
			}
			public override BuiltinIP DefaultInstanceForType
			{
				get
				{
					return BuiltinIP.DefaultInstance;
				}
			}
			public uint Type
			{
				get
				{
					return this.result.Type;
				}
				set
				{
					this.SetType(value);
				}
			}
			public uint Port
			{
				get
				{
					return this.result.Port;
				}
				set
				{
					this.SetPort(value);
				}
			}
			public ByteString IP
			{
				get
				{
					return this.result.IP;
				}
				set
				{
					this.SetIP(value);
				}
			}
			public Builder()
			{
				this.result = BuiltinIP.DefaultInstance;
				this.resultIsReadOnly = true;
			}
			internal Builder(BuiltinIP cloneFrom)
			{
				this.result = cloneFrom;
				this.resultIsReadOnly = true;
			}
			private BuiltinIP PrepareBuilder()
			{
				if (this.resultIsReadOnly)
				{
					BuiltinIP other = this.result;
					this.result = new BuiltinIP();
					this.resultIsReadOnly = false;
					this.MergeFrom(other);
				}
				return this.result;
			}
			public override BuiltinIP.Builder Clear()
			{
				this.result = BuiltinIP.DefaultInstance;
				this.resultIsReadOnly = true;
				return this;
			}
			public override BuiltinIP.Builder Clone()
			{
				if (this.resultIsReadOnly)
				{
					return new BuiltinIP.Builder(this.result);
				}
				return new BuiltinIP.Builder().MergeFrom(this.result);
			}
			public override BuiltinIP BuildPartial()
			{
				if (this.resultIsReadOnly)
				{
					return this.result;
				}
				this.resultIsReadOnly = true;
				return this.result.MakeReadOnly();
			}
			public override BuiltinIP.Builder MergeFrom(IMessageLite other)
			{
				if (other is BuiltinIP)
				{
					return this.MergeFrom((BuiltinIP)other);
				}
				base.MergeFrom(other);
				return this;
			}
			public override BuiltinIP.Builder MergeFrom(BuiltinIP other)
			{
				return this;
			}
			public override BuiltinIP.Builder MergeFrom(ICodedInputStream input)
			{
				return this.MergeFrom(input, ExtensionRegistry.Empty);
			}
			public override BuiltinIP.Builder MergeFrom(ICodedInputStream input, ExtensionRegistry extensionRegistry)
			{
				this.PrepareBuilder();
				uint num;
				string text;
				while (input.ReadTag(out num, out text))
				{
					if (num == 0u && text != null)
					{
						int num2 = Array.BinarySearch<string>(BuiltinIP._builtinIPFieldNames, text, StringComparer.get_Ordinal());
						if (num2 < 0)
						{
							this.ParseUnknownField(input, extensionRegistry, num, text);
							continue;
						}
						num = BuiltinIP._builtinIPFieldTags[num2];
					}
					uint num3 = num;
					if (num3 <= 8u)
					{
						if (num3 == 0u)
						{
							throw InvalidProtocolBufferException.InvalidTag();
						}
						if (num3 == 8u)
						{
							this.result.hasType = input.ReadUInt32(ref this.result.type_);
							continue;
						}
					}
					else
					{
						if (num3 == 16u)
						{
							this.result.hasPort = input.ReadUInt32(ref this.result.port_);
							continue;
						}
						if (num3 == 26u)
						{
							this.result.hasIP = input.ReadBytes(ref this.result.iP_);
							continue;
						}
					}
					if (WireFormat.IsEndGroupTag(num))
					{
						return this;
					}
					this.ParseUnknownField(input, extensionRegistry, num, text);
				}
				return this;
			}
			public BuiltinIP.Builder SetType(uint value)
			{
				this.PrepareBuilder();
				this.result.hasType = true;
				this.result.type_ = value;
				return this;
			}
			public BuiltinIP.Builder ClearType()
			{
				this.PrepareBuilder();
				this.result.hasType = false;
				this.result.type_ = 0u;
				return this;
			}
			public BuiltinIP.Builder SetPort(uint value)
			{
				this.PrepareBuilder();
				this.result.hasPort = true;
				this.result.port_ = value;
				return this;
			}
			public BuiltinIP.Builder ClearPort()
			{
				this.PrepareBuilder();
				this.result.hasPort = false;
				this.result.port_ = 0u;
				return this;
			}
			public BuiltinIP.Builder SetIP(ByteString value)
			{
				ThrowHelper.ThrowIfNull(value, "value");
				this.PrepareBuilder();
				this.result.hasIP = true;
				this.result.iP_ = value;
				return this;
			}
			public BuiltinIP.Builder ClearIP()
			{
				this.PrepareBuilder();
				this.result.hasIP = false;
				this.result.iP_ = ByteString.Empty;
				return this;
			}
		}
		public const int TypeFieldNumber = 1;
		public const int PortFieldNumber = 2;
		public const int IPFieldNumber = 3;
		private static readonly BuiltinIP defaultInstance;
		private static readonly string[] _builtinIPFieldNames;
		private static readonly uint[] _builtinIPFieldTags;
		private bool hasType;
		private uint type_;
		private bool hasPort;
		private uint port_;
		private bool hasIP;
		private ByteString iP_ = ByteString.Empty;
		private int memoizedSerializedSize = -1;
		public static BuiltinIP DefaultInstance
		{
			get
			{
				return BuiltinIP.defaultInstance;
			}
		}
		public override BuiltinIP DefaultInstanceForType
		{
			get
			{
				return BuiltinIP.DefaultInstance;
			}
		}
		protected override BuiltinIP ThisMessage
		{
			get
			{
				return this;
			}
		}
		public uint Type
		{
			get
			{
				return this.type_;
			}
		}
		public uint Port
		{
			get
			{
				return this.port_;
			}
		}
		public ByteString IP
		{
			get
			{
				return this.iP_;
			}
		}
		public override bool IsInitialized
		{
			get
			{
				return this.hasType && this.hasPort && this.hasIP;
			}
		}
		public override int SerializedSize
		{
			get
			{
				int num = this.memoizedSerializedSize;
				if (num != -1)
				{
					return num;
				}
				num = 0;
				if (this.hasType)
				{
					num += CodedOutputStream.ComputeUInt32Size(1, this.Type);
				}
				if (this.hasPort)
				{
					num += CodedOutputStream.ComputeUInt32Size(2, this.Port);
				}
				if (this.hasIP)
				{
					num += CodedOutputStream.ComputeBytesSize(3, this.IP);
				}
				this.memoizedSerializedSize = num;
				return num;
			}
		}
		private BuiltinIP()
		{
		}
		public override void WriteTo(ICodedOutputStream output)
		{
			int arg_06_0 = this.SerializedSize;
			string[] builtinIPFieldNames = BuiltinIP._builtinIPFieldNames;
			if (this.hasType)
			{
				output.WriteUInt32(1, builtinIPFieldNames[2], this.Type);
			}
			if (this.hasPort)
			{
				output.WriteUInt32(2, builtinIPFieldNames[1], this.Port);
			}
			if (this.hasIP)
			{
				output.WriteBytes(3, builtinIPFieldNames[0], this.IP);
			}
		}
		public override int GetHashCode()
		{
			int num = base.GetType().GetHashCode();
			if (this.hasType)
			{
				num ^= this.type_.GetHashCode();
			}
			if (this.hasPort)
			{
				num ^= this.port_.GetHashCode();
			}
			if (this.hasIP)
			{
				num ^= this.iP_.GetHashCode();
			}
			return num;
		}
		public override bool Equals(object object_0)
		{
			BuiltinIP builtinIP = object_0 as BuiltinIP;
			return builtinIP != null && (this.hasType == builtinIP.hasType && (!this.hasType || this.type_.Equals(builtinIP.type_))) && (this.hasPort == builtinIP.hasPort && (!this.hasPort || this.port_.Equals(builtinIP.port_))) && (this.hasIP == builtinIP.hasIP && (!this.hasIP || this.iP_.Equals(builtinIP.iP_)));
		}
		public override void PrintTo(TextWriter writer)
		{
			GeneratedMessageLite<BuiltinIP, BuiltinIP.Builder>.PrintField("type", this.hasType, this.type_, writer);
			GeneratedMessageLite<BuiltinIP, BuiltinIP.Builder>.PrintField("port", this.hasPort, this.port_, writer);
			GeneratedMessageLite<BuiltinIP, BuiltinIP.Builder>.PrintField("IP", this.hasIP, this.iP_, writer);
		}
		public static BuiltinIP ParseFrom(byte[] data)
		{
			return BuiltinIP.CreateBuilder().MergeFrom(data).BuildParsed();
		}
		private BuiltinIP MakeReadOnly()
		{
			return this;
		}
		public static BuiltinIP.Builder CreateBuilder()
		{
			return new BuiltinIP.Builder();
		}
		public override BuiltinIP.Builder ToBuilder()
		{
			return BuiltinIP.CreateBuilder(this);
		}
		public override BuiltinIP.Builder CreateBuilderForType()
		{
			return new BuiltinIP.Builder();
		}
		public static BuiltinIP.Builder CreateBuilder(BuiltinIP prototype)
		{
			return new BuiltinIP.Builder(prototype);
		}
		static BuiltinIP()
		{
			BuiltinIP.defaultInstance = new BuiltinIP().MakeReadOnly();
			BuiltinIP._builtinIPFieldNames = new string[]
			{
				"IP",
				"port",
				"type"
			};
			BuiltinIP._builtinIPFieldTags = new uint[]
			{
				26u,
				16u,
				8u
			};
			object.ReferenceEquals(micromsg.Proto.BuiltinIP.Descriptor, null);
		}
	}
}
